class AlbumsController < ApplicationController

  before_filter :load_album, :only => [ :show ]
  before_filter :load_albums, :only => [ :index ]
  before_filter :find_tagged, :only => [ :tagged ]
  
  layout "two_column"

  protected
  def load_albums
    @albums = Album.paginate(:page => params[:page], :order => 'created_at DESC')
  end

  def load_album
    @album = Album.find(params[:id])
  end

  public
  def index
    respond_to do |format|
      format.html
      format.rss {render :layout => false}
      format.xml  { render :xml => @albums }
    end
  end

  def show          
    respond_to do |format|
      format.html
      format.xml { render :xml => @album }
    end
  end
end
